﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FeedbackDetail.aspx.cs" Inherits="UI_Mail_FeedbackDetail" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head runat="server">
    <title></title>
    <link href="../../js/jquery.easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../js/jquery.easyui/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="../../js/jquery.easyui/jquery.min.js" type="text/javascript"></script>
    <script src="../../js/jquery.easyui/jquery.easyui.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="http://www.jeasyui.com/easyui/datagrid-detailview.js"></script>
    <script type="text/javascript">
     $(document).ready(function(){
       var eBayUserID = request.QueryString('ebayuserid');
       var orderID = request.QueryString('orderid');
       $('#feedback').datagrid({
         fitColumns: true,
         loadMsg: '正在加载, 请稍后...',
         url: '../../TableHanders.aspx?act=q&tid=8009&type=0',
         nowrap: false,
         singleSelect: true,
         columns: [[
           { field: 'ID', title: 'ID', hidden: true },
           { field: 'Type', title: '类型', width: 60 },
           {
             field: 'Information', title: '标题', width:200,
             formatter: function (value, row, index) { return '<div style="text-overflow:ellipsis; white-space:nowrap; overflow:hidden;"><a href="http://www.ebay.co.uk/itm/' + row['ItemID'] + '" target="_blank">' + row['ItemTitle'] + '</a></div>' + row['ItemID']; }
           },
           { field: 'Message', title: '留言', halign: 'center', width:400 },
           { field: 'Date', title: '评价日期', width: 120, align: 'center' },
           { field: 'Status', title: '状态', width: 40 },
           { field: 'Reason', title: '原因' }
         ]],
         queryParams: { 'eBayUserID': eBayUserID, 'OrderID': orderID },
         view: detailview,
         detailFormatter: function (index, row) {
           return '<div id="ddv-' + index + '" class="ddv" style="padding:5px 0;overflow-y:auto;"></div>';
         },
         onExpandRow: function (index, row) {
           var ddv = $(this).datagrid('getRowDetail', index).find('div#ddv-' + index);
           ddv.panel({
             height: 380,
             border: false,
             cache: false,
             href: './GetFeedbackDetail.aspx?ebayuserid=' + eBayUserID + '&feedbackid=' + row['ID'] + '&index=' + index,
             onLoad: function () {
               $('#feedback').datagrid('fixDetailRowHeight', index);
             }
           });
           $('#feedback').datagrid('fixDetailRowHeight', index);
         }
       });
     });
       
     var request = {
       QueryString: function (val) {
         var url = window.location.search;
         var re = new RegExp('' + val + '=([^&?]*)', 'ig');
         return ((url.match(re)) ? (url.match(re)[0].substr(val.length + 1)) : null);
       }
     };
    </script>
  </head>
  <body>
    <div>
      <table id="feedback"></table>
    </div>
  </body>
</html>
